package com.eclipse.e0112_多线程.聊天_0113晨考;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Scanner;

public class Client {
	private static Scanner scanner = new Scanner(System.in);
	private static String ip = "10.70.30.254";
	private static int port = 8081;

	public static void main(String[] args) throws UnknownHostException, IOException {
		Socket socket = new Socket(ip, port);
		OutputStream outputStream = socket.getOutputStream();
		BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outputStream));

		while (true) {
			System.out.println("客户端输入信息:");
			String info = scanner.nextLine();
			out.write(info + "\r\n");
			out.flush();
		}
	}
}
